using System;

namespace Catastrophe.AutoSulution.TimeCal
{
	public class ProTimeInfo
	{
		/// <summary>
		/// 无效的时间s
		/// </summary>
		public double SumTime;

		public DateTime? BreakTime = null;

		/// <summary>
		/// 延时启动时间
		/// </summary>
		public int DelayTime;

		/// <summary>
		///     上次有效时间、上次I无效时间、当前有效时间、当前无效时间
		/// </summary>
		public double LastTime;

		/// <summary>
		///     上次有效时间、上次I无效时间、当前有效时间、当前无效时间
		/// </summary>
		public double NowTime;

		/// <summary>
		///     无效总时间格式化
		/// </summary>
		public string SumTimeFormat => TimeHelper.TimeToStrFormat(this.SumTime);

		/// <summary>
		///     停机开始距离设定时间倒计时s
		/// </summary>
		public double StopRemainTime { get; set; }

		/// <summary>
		///     无效总时间格式化
		/// </summary>
		public string StopRemainTimeFormat
		{
			get
			{
				if (this.StopRemainTime > 0.0)
				{
					return this.StopRemainTime.ToString("0");
				}
				return "--";
			}
			set
			{
			}
		}

		public int SleepTime { get; set; }

		/// <summary>
		/// 清空、初始化
		/// </summary>
		public void Clear()
		{
			this.LastTime = 0.0;
			this.NowTime = 0.0;
			this.BreakTime = DateTime.Now;
			this.SumTime = 0.0;
		}
	}
}
